import instance from "../../utils/request";

export function findPage(searchParams) {
    //向后台发送请求，得到数据
    return instance.get(`/type/findList`,{params: searchParams});
}

export function findlistType() {
    return instance.get(`/type/list`);
}
export function findById(id) {
    return instance.get(`/type/findById/${id}`);
}



/**
 * 添加
 * @param entity
 * @returns {*}
 */
export function insert(entity){
    return instance.post(`/type/addType/`,entity);
}



export function deleteById(id){
    return instance.delete(`/type/deleteById/${id}`);
}

export function batchDelete(ids) {
    return instance.delete(`/type/batchDeleteByIds/${ids}`)
}

/**
 * 根据id查询
 */

export function updateById(entity) {
    return instance.put(`/type/`,entity);
}
export function getTree() {
    return instance.get(`/type/tree`);
}

export function SelectTree() {
    return instance.get(`/type/selectTree`);
}


